Repository navigation
fix(plugin): stop the cache purge drain on a rate-limited batch - #4303
Conversation
When Cloudflare rate-limited a purge batch, the drain requeued it at its Retry-After and immediately claimed the next batch, so concurrent drains cycled through the whole queue every few seconds and kept the purge quota spent: in prod thousands of 429s a minute and no purge got through. The drain now stops after a failed batch, and a zone that answered 429 is not called again for the rest of the batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merging this PR will not alter performance
Comparing Footnotes
|
|
@coderabbitai review |
Action not completed
|
|
|
@coderabbitai review |
Action not completed
|



Summary
Prod fix found while monitoring the release of #4290. The
/updatescache purge queue (updates_cache_purge_pending) stopped draining. 733 apps were due and none purged for over 30 minutes, while the API worker logged thousands ofupdates cache purge failed(Cloudflare429) a minute.The cause is in the purge drain. When Cloudflare rate-limited a batch,
drainUpdatesCachePurgeacked it for its Retry-After and immediately claimed the next 100 apps. Several drains run at once (each wakeup and eachon_version_updatenudge starts one). Together they cycled through the whole queue every few seconds, which kept the zone purge quota spent, so no purge got through. Within a batch,purgeUpdatesCacheTagsalso kept calling a zone after it answered 429.Test plan
bun run test:unit(678 files, 8,187 tests),bun run typecheck:backend,bun run lint:backendupdates_cache_purge_pendingdrains, and 429 logs drop.No rendered UI changes, so there are no screenshots.
🤖 Generated with Claude Code